package date.duration;

import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Date;

public class MyDuration {
    public static void main(String[] args) {
        Duration duration1 = Duration.ofDays(2);
        Duration duration2 = Duration.ofDays(3);
        System.out.println(duration1);
        System.out.println(duration2);
        LocalDateTime localDateTime1 = LocalDateTime.now();
        LocalDateTime localDateTime2 = LocalDateTime.of(2022,10,15,15,15);
        Duration between = Duration.between(localDateTime1, localDateTime2);
        System.out.println(between.getSeconds());
    }

}
